package com.linkage.educloud.ah.vnet;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by 周振 on 2018/4/19.
 * 用户发送失败，重发暂存消息体
 */

public class ErrorMessage implements Parcelable {
    //接收者id
    private String buddyid;
    //消息类型 PushConsts.ChatType.TEXT  三种
    private int msgType;
    //Uri,用户更新数据库
    private Uri uri;
    //内容
    private String message;
    //群发还是单聊这里用的是和教育的类型，
    private int chatType;

    public ErrorMessage() {
    }

    public String getBuddyid() {
        return buddyid;
    }

    public void setBuddyid(String buddyid) {
        this.buddyid = buddyid;
    }

    public int getMsgType() {
        return msgType;
    }

    public void setMsgType(int msgType) {
        this.msgType = msgType;
    }

    public Uri getUri() {
        return uri;
    }

    public void setUri(Uri uri) {
        this.uri = uri;
    }

    public int getChatType() {
        return chatType;
    }

    public void setChatType(int chatType) {
        this.chatType = chatType;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.buddyid);
        dest.writeInt(this.msgType);
        dest.writeParcelable(this.uri, flags);
        dest.writeString(this.message);
        dest.writeInt(this.chatType);
    }

    protected ErrorMessage(Parcel in) {
        this.buddyid = in.readString();
        this.msgType = in.readInt();
        this.uri = in.readParcelable(Uri.class.getClassLoader());
        this.message = in.readString();
        this.chatType = in.readInt();
    }

    public static final Creator<ErrorMessage> CREATOR = new Creator<ErrorMessage>() {
        @Override
        public ErrorMessage createFromParcel(Parcel source) {
            return new ErrorMessage(source);
        }

        @Override
        public ErrorMessage[] newArray(int size) {
            return new ErrorMessage[size];
        }
    };

}
